<?
/**
 * 微店资料上传
 * User: KaZeline Zax
 * Date: 2014-11-28
 * Time: 上午9:25
 */
 exit;
include'../../../com.inc.php';
include('../../common/autoload.php');
$fid = $_SESSION['memberID'];
// $_POST = $_REQUEST;
$tplid= $_POST['radio1']+0; 
$sub_domain   = $_POST['sub_domain'];
$telephone      = $_POST['tel'];
if(!isphone($telephone)&&!ismobile($telephone)){
    exit('{"res":0,"msg":"服务电话格式不正确"}');
}
$copyright     = $_POST['copyright'];
if (p_match($copyright)) {
    exit('{"res":0,"msg":"版权信息含有非法字符"}');
}
//$qrcode         = $_POST['qrcode'];
$my_domain = $_POST['sld'];
if (p_match($my_domain)) {
    exit('{"res":0,"msg":"域名含有非法字符"}');
}
$my_name = $_POST['web_name'];
if (p_match($my_name)) {
    exit('{"res":0,"msg":"网站名称含有非法字符"}');
}
$sql = "select id from pft_shops where sub_domain='$sub_domain'";
$GLOBALS['le']->query($sql);
if ($row = $GLOBALS['le']->fetch_assoc()) {
    exit('{"res":0,"msg":"该域名已存在"}');
}
//上传图片
include'../../call/uploadShopTplImage.php';
// $logo_path =  $imgPath['logo'];
// $slide_img1 = $imgPath['im1'];
// $slide_img2 = $imgPath['im2'];
// $slide_img3 = $imgPath['im3'];
// $slide_img4 = $imgPath['im4'];
$logo_path  = $logo;
$slide_img1 = $im1;
$slide_img2 = $im2;
$slide_img3 = $im3;
$slide_img4 = $im4;

$sql = "INSERT into pft_member_domain_info
           (fid,tplid,my_domain,logo_path,telephone,slide_img1,slide_img2,slide_img3,slide_img4,copyright,qrcode) values
           ($fid,$tplid,$my_domain,$logo_path,$telephone,$slide_img1,$slide_img2,$slide_img3,$slide_img4,$copyright,$qrcode)";
$GLOBALS['le']->query($sql);

?>